<ui:composition template="/xhtml/component/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:t="http://myfaces.apache.org/tomahawk">
	<ui:define name="page">
		<h:form prependId="false">
			<t:saveState value="#{recommenderBean}" />
			<p:commandButton id="btnFinish" value="#{msg.label_finish}"
				action="#{recommenderBean.back}" ajax="false"
				rendered="#{!recommenderBean.showSearchUser}" />
			<br />
			<p:outputPanel id="pnlPreferences"
				style="width: 97%; text-align: center;">				
				<p:tabView>
					<p:tab title="#{msg.label_recommendations}">
						<br/>
						<p:messages id="messages" showDetail="true" />
						<br/>
						<p:outputPanel layout="block" style="width: 99%; text-align: left;"
							rendered="#{recommenderBean.showSearchUser}">
							<h:outputLabel value="#{msg.label_user_email}:" />
							<h:inputText id="userEmail" maxlength="100" size="40"
								value="#{recommenderBean.userEmail}" />
							<p:commandButton id="btnLoadPreferences"
								value="#{msg.label_load}"
								action="#{recommenderBean.loadRecommendations}" ajax="false" />
						</p:outputPanel>
						<br />						
						<br />
						<br />
						<h:panelGrid columns="2" style="text-align: center; width: 99%;" columnClasses="column column">
							<p:outputPanel layout="block" style="text-align: center; width: 100%;">
								<h:outputText styleClass="recommendations_title"
									value="#{msg.label_recommendations_only_own_context}" />
								<br />
								<br />
								<br />
								<br />
								<p:dataTable var="preference"
									value="#{recommenderBean.moviesOnlyOwnContext}" style="text-align: center;">
									<p:column styleClass="movie_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_movie}" />
										</f:facet>
										<h:outputText value="#{preference.item.description}" />
									</p:column>
									<p:column styleClass="movie_rate_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_rate}" />
										</f:facet>
										<h:outputText value="#{preference.rate}">
											<f:convertNumber type="number" minFractionDigits="2"
												maxIntegerDigits="2" pattern="0.00" />
										</h:outputText>
									</p:column>
								</p:dataTable>
								<br />
								<p:dataTable var="preference"
									value="#{recommenderBean.singersOnlyOwnContext}">
									<p:column styleClass="singer_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_singer}" />
										</f:facet>
										<h:outputText value="#{preference.item.description}" />
									</p:column>
									<p:column styleClass="singer_rate_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_rate}" />
										</f:facet>
										<h:outputText value="#{preference.rate}">
											<f:convertNumber type="number" minFractionDigits="2"
												maxIntegerDigits="2" pattern="0.00" />
										</h:outputText>
									</p:column>
								</p:dataTable>
								<br />
								<p:dataTable var="preference"
									value="#{recommenderBean.booksOnlyOwnContext}">
									<p:column styleClass="book_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_book}" />
										</f:facet>
										<h:outputText value="#{preference.item.description}" />
									</p:column>
									<p:column styleClass="book_rate_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_rate}" />
										</f:facet>
										<h:outputText value="#{preference.rate}">
											<f:convertNumber type="number" minFractionDigits="2"
												maxIntegerDigits="2" pattern="0.00" />
										</h:outputText>
									</p:column>
								</p:dataTable>
							</p:outputPanel>
							<p:outputPanel layout="block" style="text-align: center; width: 100%;">
								<h:outputText styleClass="recommendations_title"
									value="#{msg.label_recommendations_all_contexts}" />
								<br />
								<br />
								<br />
								<br />
								<p:dataTable var="preference"
									value="#{recommenderBean.moviesWithAllContext}">
									<p:column styleClass="movie_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_movie}" />
										</f:facet>
										<h:outputText value="#{preference.item.description}" />
									</p:column>
									<p:column styleClass="movie_rate_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_rate}" />
										</f:facet>
										<h:outputText value="#{preference.rate}">
											<f:convertNumber type="number" minFractionDigits="2"
												maxIntegerDigits="2" pattern="0.00" />
										</h:outputText>
									</p:column>
								</p:dataTable>
								<br />
								<p:dataTable var="preference"
									value="#{recommenderBean.singersWithAllContext}">
									<p:column styleClass="singer_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_singer}" />
										</f:facet>
										<h:outputText value="#{preference.item.description}" />
									</p:column>
									<p:column styleClass="singer_rate_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_rate}" />
										</f:facet>
										<h:outputText value="#{preference.rate}">
											<f:convertNumber type="number" minFractionDigits="2"
												maxIntegerDigits="2" pattern="0.00" />
										</h:outputText>
									</p:column>
								</p:dataTable>
								<br />
								<p:dataTable var="preference"
									value="#{recommenderBean.booksWithAllContext}">
									<p:column styleClass="book_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_book}" />
										</f:facet>
										<h:outputText value="#{preference.item.description}" />
									</p:column>
									<p:column styleClass="book_rate_column">
										<f:facet name="header">
											<h:outputText value="#{msg.label_rate}" />
										</f:facet>
										<h:outputText value="#{preference.rate}">
											<f:convertNumber type="number" minFractionDigits="2"
												maxIntegerDigits="2" pattern="0.00" />
										</h:outputText>
									</p:column>
								</p:dataTable>
							</p:outputPanel>
						</h:panelGrid>
					</p:tab>
				</p:tabView>
			</p:outputPanel>
		</h:form>
	</ui:define>
</ui:composition>